package com.bnzj.cloud.business.core.service;

import org.springframework.stereotype.Service;

import com.bnzj.cloud.business.core.persistence.entity.SysActionLog;
import com.bnzj.cloud.business.core.persistence.repository.SysActionLogRepository;
import com.bnzj.core.action.log.ActionLog;
import com.bnzj.core.action.log.ActionLogService;
import com.bnzj.core.persistence.BaseService;
import com.bnzj.core.persistence.query.QueryHelpBean;

@Service
public class SysActionLogService extends BaseService<SysActionLogRepository, SysActionLog, Long> implements ActionLogService {
	
    public static QueryHelpBean getQueryHelpBean() {
        String selectSQL = "select *";
        String whereSQL = " from bnz_sys_action_log where 1=1 ";
        QueryHelpBean queryBean = new QueryHelpBean(selectSQL + whereSQL, "select count(1)" + whereSQL, SysActionLog.class);
        return queryBean;
    }

    @Override
    public void add(ActionLog actionLog) {
        if (actionLog instanceof SysActionLog) {
            this.save((SysActionLog)actionLog);
        }
    }

    @Override
    public ActionLog createActionLog() {
        return new SysActionLog();
    }
}
